<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Page Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>

<body>
    <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
    <script>
        //外网IP地址
        var ip = returnCitySN["cip"];
        console.log(ip);
        var url = "http://pv.sohu.com/cityjson?ie=utf-8";
        $.ajax({
                type: "get",
                url: url,
                dataType: 'jsonp',
                jsonp: "callback", //这里定义了callback的参数名称，以便服务获取callback的函数名即getMessage
                jsonpCallback: "getMessage", //这里定义了jsonp的回调函数

            }).done((data) => {
                console.log(data);
            })
            .fail((data) => {
                console.log(data);
            });

        function getMessage(data) {
            console.log('getMessage');
            console.log(data);
        }

        $.getScript(url, (data) => {
            console.log(data);
        })
    </script>
</body>

</html>